<template>
	<view class="example">
		<text class="title">多数据，多节点选择</text>
		<ifun-legacy-tree-picker :value="value" :data="treeData" :treeOptions="options" @ok="handleConfirm">

		</ifun-legacy-tree-picker>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				value:{code:'02001'},
				options:{
					value:'code'
				},
				treeData: [
				]
			}
		},
		mounted(){
			 const random = (p)=>Array(20).fill().map((val,index)=>{
				let code = p+"00"+index
				
				return {
					code,
					label:"测试"+code,
				}
			})
			this.treeData = random('').map(item=>({...item,children:random(item.code).map(info=>({...info,children:random(info.code)}))}))
		},
		methods:{
			handleConfirm(node,nodes){
				console.log(node,nodes)
			}
		}
	}
</script>

<style>
</style>